home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / Windows.p < prev   
Encoding:
Text File  |  1992-01-29  |  7.1 KB  |  278 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Monday, September 16, 1991 at 1:41 AM
  4.  Windows.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1985-1991
  8.   All rights reserved.
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT Windows;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingWindows}
  22. {$SETC UsingWindows := 1}
  23.  
  24. {$I+}
  25. {$SETC WindowsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingQuickdraw}
  28. {$I $$Shell(PInterfaces)Quickdraw.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingEvents}
  31. {$I $$Shell(PInterfaces)Events.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingControls}
  34. {$I $$Shell(PInterfaces)Controls.p}
  35. {$ENDC}
  36. {$SETC UsingIncludes := WindowsIncludes}
  37.  
  38. CONST
  39. documentProc = 0;
  40. dBoxProc = 1;
  41. plainDBox = 2;
  42. altDBoxProc = 3;
  43. noGrowDocProc = 4;
  44. movableDBoxProc = 5;
  45. zoomDocProc = 8;
  46. zoomNoGrow = 12;
  47. rDocProc = 16;
  48. dialogKind = 2;
  49. userKind = 8;
  50.  
  51. {FindWindow Result Codes}
  52. inDesk = 0;
  53. inMenuBar = 1;
  54. inSysWindow = 2;
  55. inContent = 3;
  56. inDrag = 4;
  57. inGrow = 5;
  58. inGoAway = 6;
  59. inZoomIn = 7;
  60. inZoomOut = 8;
  61.  
  62. {window messages}
  63. wDraw = 0;
  64. wHit = 1;
  65. wCalcRgns = 2;
  66. wNew = 3;
  67. wDispose = 4;
  68. wGrow = 5;
  69. wDrawGIcon = 6;
  70.  
  71. {defProc hit test codes}
  72. wNoHit = 0;
  73. wInContent = 1;
  74. wInDrag = 2;
  75. wInGrow = 3;
  76. wInGoAway = 4;
  77. wInZoomIn = 5;
  78. wInZoomOut = 6;
  79. deskPatID = 16;
  80.  
  81. {Window Part Identifiers which correlate color table entries with window elements}
  82. wContentColor = 0;
  83. wFrameColor = 1;
  84. wTextColor = 2;
  85. wHiliteColor = 3;
  86. wTitleBarColor = 4;
  87.  
  88. TYPE
  89. WindowPeek = ^WindowRecord;
  90. WindowRecord = RECORD
  91.  port: GrafPort;
  92.  windowKind: INTEGER;
  93.  visible: BOOLEAN;
  94.  hilited: BOOLEAN;
  95.  goAwayFlag: BOOLEAN;
  96.  spareFlag: BOOLEAN;
  97.  strucRgn: RgnHandle;
  98.  contRgn: RgnHandle;
  99.  updateRgn: RgnHandle;
  100.  windowDefProc: Handle;
  101.  dataHandle: Handle;
  102.  titleHandle: StringHandle;
  103.  titleWidth: INTEGER;
  104.  controlList: ControlHandle;
  105.  nextWindow: WindowPeek;
  106.  windowPic: PicHandle;
  107.  refCon: LONGINT;
  108.  END;
  109.  
  110. CWindowPeek = ^CWindowRecord;
  111. CWindowRecord = RECORD
  112.  port: CGrafPort;
  113.  windowKind: INTEGER;
  114.  visible: BOOLEAN;
  115.  hilited: BOOLEAN;
  116.  goAwayFlag: BOOLEAN;
  117.  spareFlag: BOOLEAN;
  118.  strucRgn: RgnHandle;
  119.  contRgn: RgnHandle;
  120.  updateRgn: RgnHandle;
  121.  windowDefProc: Handle;
  122.  dataHandle: Handle;
  123.  titleHandle: StringHandle;
  124.  titleWidth: INTEGER;
  125.  controlList: ControlHandle;
  126.  nextWindow: CWindowPeek;
  127.  windowPic: PicHandle;
  128.  refCon: LONGINT;
  129.  END;
  130.  
  131. WStateDataPtr = ^WStateData;
  132. WStateDataHandle = ^WStateDataPtr;
  133. WStateData = RECORD
  134.  userState: Rect;            {user state}
  135.  stdState: Rect;            {standard state}
  136.  END;
  137.  
  138. AuxWinPtr = ^AuxWinRec;
  139. AuxWinHandle = ^AuxWinPtr;
  140. AuxWinRec = RECORD
  141.  awNext: AuxWinHandle;        {handle to next AuxWinRec}
  142.  awOwner: WindowPtr;        {ptr to window }
  143.  awCTable: CTabHandle;        {color table for this window}
  144.  dialogCItem: Handle;        {handle to dialog manager structures}
  145.  awFlags: LONGINT;            {reserved for expansion}
  146.  awReserved: CTabHandle;    {reserved for expansion}
  147.  awRefCon: LONGINT;            {user Constant}
  148.  END;
  149.  
  150. WCTabPtr = ^WinCTab;
  151. WCTabHandle = ^WCTabPtr;
  152. WinCTab = RECORD
  153.  wCSeed: LONGINT;            {reserved}
  154.  wCReserved: INTEGER;        {reserved}
  155.  ctSize: INTEGER;            {usually 4 for windows}
  156.  ctTable: ARRAY [0..4] OF ColorSpec;
  157.  END;
  158.  
  159.  
  160. PROCEDURE InitWindows;
  161.  INLINE $A912;
  162. PROCEDURE GetWMgrPort(VAR wPort: GrafPtr);
  163.  INLINE $A910;
  164. FUNCTION NewWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  165.  theProc: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  166.  INLINE $A913;
  167. FUNCTION GetNewWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  168.  INLINE $A9BD;
  169. PROCEDURE CloseWindow(theWindow: WindowPtr);
  170.  INLINE $A92D;
  171. PROCEDURE DisposeWindow(theWindow: WindowPtr);
  172.  INLINE $A914;
  173. PROCEDURE GetWTitle(theWindow: WindowPtr;VAR title: Str255);
  174.  INLINE $A919;
  175. PROCEDURE SelectWindow(theWindow: WindowPtr);
  176.  INLINE $A91F;
  177. PROCEDURE HideWindow(theWindow: WindowPtr);
  178.  INLINE $A916;
  179. PROCEDURE ShowWindow(theWindow: WindowPtr);
  180.  INLINE $A915;
  181. PROCEDURE ShowHide(theWindow: WindowPtr;showFlag: BOOLEAN);
  182.  INLINE $A908;
  183. PROCEDURE HiliteWindow(theWindow: WindowPtr;fHilite: BOOLEAN);
  184.  INLINE $A91C;
  185. PROCEDURE BringToFront(theWindow: WindowPtr);
  186.  INLINE $A920;
  187. PROCEDURE SendBehind(theWindow: WindowPtr;behindWindow: WindowPtr);
  188.  INLINE $A921;
  189. FUNCTION FrontWindow: WindowPtr;
  190.  INLINE $A924;
  191. PROCEDURE DrawGrowIcon(theWindow: WindowPtr);
  192.  INLINE $A904;
  193. PROCEDURE MoveWindow(theWindow: WindowPtr;hGlobal: INTEGER;vGlobal: INTEGER;
  194.  front: BOOLEAN);
  195.  INLINE $A91B;
  196. PROCEDURE SizeWindow(theWindow: WindowPtr;w: INTEGER;h: INTEGER;fUpdate: BOOLEAN);
  197.  INLINE $A91D;
  198. PROCEDURE ZoomWindow(theWindow: WindowPtr;partCode: INTEGER;front: BOOLEAN);
  199.  INLINE $A83A;
  200. PROCEDURE InvalRect(badRect: Rect);
  201.  INLINE $A928;
  202. PROCEDURE InvalRgn(badRgn: RgnHandle);
  203.  INLINE $A927;
  204. PROCEDURE ValidRect(goodRect: Rect);
  205.  INLINE $A92A;
  206. PROCEDURE ValidRgn(goodRgn: RgnHandle);
  207.  INLINE $A929;
  208. PROCEDURE BeginUpdate(theWindow: WindowPtr);
  209.  INLINE $A922;
  210. PROCEDURE EndUpdate(theWindow: WindowPtr);
  211.  INLINE $A923;
  212. PROCEDURE SetWRefCon(theWindow: WindowPtr;data: LONGINT);
  213.  INLINE $A918;
  214. FUNCTION GetWRefCon(theWindow: WindowPtr): LONGINT;
  215.  INLINE $A917;
  216. PROCEDURE SetWindowPic(theWindow: WindowPtr;pic: PicHandle);
  217.  INLINE $A92E;
  218. FUNCTION GetWindowPic(theWindow: WindowPtr): PicHandle;
  219.  INLINE $A92F;
  220. FUNCTION CheckUpdate(VAR theEvent: EventRecord): BOOLEAN;
  221.  INLINE $A911;
  222. PROCEDURE ClipAbove(window: WindowPeek);
  223.  INLINE $A90B;
  224. PROCEDURE SaveOld(window: WindowPeek);
  225.  INLINE $A90E;
  226. PROCEDURE DrawNew(window: WindowPeek;update: BOOLEAN);
  227.  INLINE $A90F;
  228. PROCEDURE PaintOne(window: WindowPeek;clobberedRgn: RgnHandle);
  229.  INLINE $A90C;
  230. PROCEDURE PaintBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  231.  INLINE $A90D;
  232. PROCEDURE CalcVis(window: WindowPeek);
  233.  INLINE $A909;
  234. PROCEDURE CalcVisBehind(startWindow: WindowPeek;clobberedRgn: RgnHandle);
  235.  INLINE $A90A;
  236. FUNCTION GrowWindow(theWindow: WindowPtr;startPt: Point;bBox: Rect): LONGINT;
  237.  INLINE $A92B;
  238. FUNCTION FindWindow(thePoint: Point;VAR theWindow: WindowPtr): INTEGER;
  239.  INLINE $A92C;
  240. FUNCTION PinRect(theRect: Rect;thePt: Point): LONGINT;
  241.  INLINE $A94E;
  242. FUNCTION DragGrayRgn(theRgn: RgnHandle;startPt: Point;boundsRect: Rect;
  243.  slopRect: Rect;axis: INTEGER;actionProc: ProcPtr): LONGINT;
  244.  INLINE $A905;
  245. FUNCTION TrackBox(theWindow: WindowPtr;thePt: Point;partCode: INTEGER): BOOLEAN;
  246.  INLINE $A83B;
  247. PROCEDURE GetCWMgrPort(VAR wMgrCPort: CGrafPtr);
  248.  INLINE $AA48;
  249. PROCEDURE SetWinColor(theWindow: WindowPtr;newColorTable: WCTabHandle);
  250.  INLINE $AA41;
  251. FUNCTION GetAuxWin(theWindow: WindowPtr;VAR awHndl: AuxWinHandle): BOOLEAN;
  252.  INLINE $AA42;
  253. PROCEDURE SetDeskCPat(deskPixPat: PixPatHandle);
  254.  INLINE $AA47;
  255. FUNCTION NewCWindow(wStorage: Ptr;boundsRect: Rect;title: Str255;visible: BOOLEAN;
  256.  procID: INTEGER;behind: WindowPtr;goAwayFlag: BOOLEAN;refCon: LONGINT): WindowPtr;
  257.  INLINE $AA45;
  258. FUNCTION GetNewCWindow(windowID: INTEGER;wStorage: Ptr;behind: WindowPtr): WindowPtr;
  259.  INLINE $AA46;
  260. FUNCTION GetWVariant(theWindow: WindowPtr): INTEGER;
  261.  INLINE $A80A;
  262. FUNCTION GetGrayRgn: RgnHandle;
  263.  INLINE $2EB8,$09EE;
  264. PROCEDURE SetWTitle(theWindow: WindowPtr;title: Str255);
  265.  INLINE $A91A;
  266. FUNCTION TrackGoAway(theWindow: WindowPtr;thePt: Point): BOOLEAN;
  267.  INLINE $A91E;
  268. PROCEDURE DragWindow(theWindow: WindowPtr;startPt: Point;boundsRect: Rect);
  269.  INLINE $A925;
  270.  
  271.  
  272. {$ENDC} { UsingWindows }
  273.  
  274. {$IFC NOT UsingIncludes}
  275.  END.
  276. {$ENDC}
  277.  
  278.